package com.redis.common.util;

import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;

import java.util.Locale;

import static javax.swing.JComponent.setDefaultLocale;

/**
 * @description:
 * @Author C_Y_J
 * @create 2022/1/12 9:40
 **/
public class SecurityMessageSourceUtil extends ReloadableResourceBundleMessageSource {

    public SecurityMessageSourceUtil() {
        setBasename("classpath:messages/messages");
        setDefaultLocale(Locale.CHINA);
    }

    public static MessageSourceAccessor getAccessor() {
        return new MessageSourceAccessor(new SecurityMessageSourceUtil());
    }
}
